\chapter{Results}
\label{cha:results}

	\section{Final state}
	\label{sec:end-state}
	
		% Describes the fulfillment of this project.

		% The production of a fully functional, low cost and low sized ECG monitoring system which employs an Android device as the user interface, and it's USB 802.15.4 receiver is completed.\\

		The production of the fully functional, low energy requiring, low sized ECG monitoring system employing an Android device as the user interface and 802.15.4 as the wireless data transferring protocol has been achieved. The system provides all the required functionality: real-time ECG wave data visualization both from 802.15.4 and Bluetooth nodes and storing of the received data in log files for afterwards visualization of these, as well as visualization parameters configuration. The system is, then, a more energy efficient and accessible version of the one produced by the Complutense University of Madrid and the École Polytechnique Fédérale de Lausanne, which is the primary objective of the project.\\

		This achievement is made thanks to the successful outcome of both the hardware research and the software development processes in which the project has been divided. Each of them requiring the employment of specific methodologies and techniques, but being, as they were, highly dependent one on the other only complicated the prediction of the outcome of them both. Thanks to the flexible scheduling conducted for each one, which considered the potential eventualities to arise in the other and focused in allowing rescheduling when necessary, this uncertainty has been correctly managed, leading to the current, successfully finalized state of the project.\\
		
		% HW: The goal of an external 802.15.4 receiver device is fulfilled. Employing it the system is able to render ECG data emitted by a delineator node. Bluetooth is also available, as well as log saving and further reading.\\
		% No olvidar hablar de modificaciones al shimmer!
		Regarding the hardware research part, the main goal pursued was the production of the 802.15.4 USB receiver device for Android systems. This device has successfully evolved from the early stages of development where a prototyping board was employed to a custom developed printed circuit board which is completely designed, validated and is being produced at the moment of writing this document.\\

		% Concrete results: X x Y x Z sized device consuming W1 watts of power (actual data, please) which compared to Bluetooth consumption (W2 watts, ...) is pretty low cost, all of this powered by the Android device, and the receiver being plug and play no installation procedure is required.\\
		The dimensions of this board are 61 x 32 x 35 mm, and it requires 3.3V for correct operation, being usable with at least 3.0V. Its USB capability allows for it to be connected to any HID compliant system, and has been successfully employed as an 802.15.4 receiver both in Android devices and Windows based personal computers.\\

		In respect of the Android application, the software development project has produced an Android application providing all required functionality, namely visualization of ECG data from Bluetooth and USB nodes, log saving and reading, and view controlling capabilities, designed and implemented in a robust, expandable manner. Moreover, the application provides a domain-specific framework for the inclusion of new data sources (like Wi-Fi or Near Field Connection) or different source data specifications.\\

		The application presents simple, easy to use user interfaces and very specific functionality, which added to the following of Android proposed application design best-practices smooth the learning curve and allow out of the box usage of the software part of the system. Due to the expansion capabilities of the system, new user interfaces or dialogs can also be added with ease.\\

		The webpage for the project is available at:\\

		\url{http://jrecas-ws.dacya.ucm.es/doku.php?id=projects:ecg_android}\\

		Besides this document, the webpage contains both the source code of the Android application and the schematic files of the receiver device, as well as further info on the project.
	
	\section{Potential additions and expansions}
	\label{sec:end-further}
		\begin{comment}
		Potential additions are to target the software frontend application. The developed Android application is a (domain specific) general purpose monitoring frontend that should provide a solid framework for further developments.\\

		Professional multipatient monitoring could come in two flavours:\\

		Visual-less multipatient monitoring in which a computer receives data from a variable number of wireless delineation nodes, e.g. employing the 802.15.4 receiver, storing it and acting as a server, or directly sending the log files to the actual server. The Android device would then download the log from the server and the own frontend application developed in the scope of this project could be used as the visualization device.\\

		The other option is simultaneous multipatient monitorization in an Android device. The monitorization application on the device would allow switching between patient ECG wave visualization while logging all received data, which could then be uploaded to a server.\\

		(Both of these expansions could find an employment in acutal medical environment.)


		More improvements can include the implementation of more detailed log navigation functionality, including information about the actual recording time and searching of specific time moments.
		Inclusion of event data into the log (like body weakness sensation or feeling of dizziness) could also be useful.
		(This two are for personal monitorization and inhome healthcare)\\

		Message sending when certain events occur (low or high hbr or arrythmia detection), text message, email, even a phone call could help constant monitorization requiring people. GPS information could be included in the message for quick localization of the affected person by the healthcare personal.

		% Comentar también como trabajo futuro los requisitos que plantea Marian
		\end{comment}

		Although every initially planned objective has been fulfilled, in addition to several of them which
		were added during the development, there is still room for improvements and features which were
		not considered or left out of scope, since the developed application is not considered as a specific
		product itself, but a framework for further developments. These improvements can be classified according 
		to the period planned for their implementation:

		\begin{itemize}
			\item \textbf{Short-term:} the following features specifically target personal use. Considering
				the user is to monitor his/her own vital signs, the next additions are thought to be useful:

				\begin{itemize}
					\item \emph{Event Tagging}\\
						Assuming the user is feeling funny or pain, it may be quite interesting for him/her
						to be able to annotate such an event with later revision purposes, either by
						him/herself or medical staff. Furthermore, the capability of marking down one peculiar
						result about the ECG delineation can also be useful.\\

						In this way, making use of the tactile interface the Android tablet features, this
						activity can be done by simply touching the relevant event or result. Next, the moment
						which that points refers is logged and a comment may be added to the annotation.\\

					\item \emph{Temporal Meta-Data}\\
						In the same conditions described in the previous item, it is possible that the user
						had felt a particular sensation in a certain moment, yet he/she was unable to mark it.
						Moreover, maybe the annotation was done and it is required to directly jump to that
						certain time.\\

						In order to ease these tasks, time-related data is to be added so that a precise
						moment of the monitoring can be directly found. In this way, the user can input
						the desired date so that the application shows what was happening at that moment.
						In addition, markers from previous annotations would also appear for quickly accessing
						to relevant events.\\

					\item \emph{Voice Commands}\\
						Due to the particular health condition of the user, or just because he/she is busy,
						direct interaction with the monitoring Android device is likely to be impossible. If
						situations like these are to happen, letting users interact with the system through
						their own voice may ease the aforementioned tasks.\\

						Fortunately, Android provides speech recognition support throughout its specific API,
						so this feature could be added without developing the whole voice recognition framework.\\

					\item \emph{Automatic Warnings}\\
						Regarding the user's health condition or unavailability again, automatic message sending
						with ECG data in case of relevant happenings were detected would mean a seamless way to
						warn the user, relatives or qualified staff if needed. In the same direction, multiple
						alternatives would be presented such as emails with GPS location attachments or direct
						automatic voice calls to complement this feature.

				\end{itemize}

				All these features come from a potential project proposed by an specific individual, which, 
				being affected of a certain cardiovascular disease and considering the goals and results of 
				this specific project, has shown interest in further specialization of the developed system for his
				particular needs. This private enterprise is yet to be started, but the inception phase has already
				begun, and is seeking funding. The team of the current project is offering consulting on the
				viability of the requirements of the project, and testing has been conducted of the already
				available system with the interested individual.\\

			\item \textbf{Long-term:} this features are mainly ideas which would grant the system with much 
				richer capabilities and new potential, though it would require of a greater amount of time
				along with specific planning and dedication.\\

				On one hand, the application can be focused towards professional multipatient monitoring,
				which could be developed in at least two alternative ways:

				\begin{itemize}
					\item Since the developed 802.15.4 USB receiver is also compatible with HID-compliant
						devices, particularly computers, multipatient monitoring could be uploaded to a
						devoted server from a variable number of wireless delineaton nodes, omitting the 
						displaying service the Android application provides. Once the data is uploaded,
						the Android device could connect with the mentioned server and download the information
						right from the developed application. Then, the Android tablet would act as usual
						as frontend of the monitoring process, displaying the downloaded data.

					\item Taking into account the relatively big display a tablet device provides, this
						multipatient monitoring paradigm could be directly implemented into the Android 
						device by extending the application's functionality. Among this new functionalities
						there would be switching between ECG wave visualizations of different patients,
						simultaneous logging and server uploading as well.
				\end{itemize}

				On the other hand, regarding self-monitoring, the system can be adap-ted to be applied to 
				specific domains which impose additional time or resource restrictions.
				Specifically the director of the Embedded Systems Laboratory at the EPFL, where the delineator 
				node employed in this project was produced in the aforementioned collaboration with the UCM, 
				has shown interest in the application of the low power requirements of the system in a specific project
				the EPFL is collaborating with: Solar Impulse \cite{solarflight}.\\

				This particular project tries to achieve a flight around the world employing no fuel, just the
				energy collected from the sun. The airplane used in the project allows only for the pilot to be
				in the cockpit throughout the flight, and, thus, he/she is required to be constantly monitorized.
				Among others, ECG monitorization is required, and is, at the time, being provided by the EPFL and
				UCM monitoring project with the already exposed battery implications of the employment of 
				Bluetooth as the wireless technology.\\

				Considering that the space in the cockpit is very reduced, and the amount of wires, sensors and
				other instruments that are present, any operation is to be done with special care and only when
				absolutely needed. Concretely, the swapping of a battery-exhausted delineator node for another,
				fully-charged one, to allow the recharging of the first, is a complex procedure as the body
				sensor network wires have to be unplugged from one node and plugged into the other. Moreover,
				while this procedure is being performed ECG monitorization is interrupted.\\

				Reducing the battery consumption of the delineator node is then, a must, and can be achieved by
				the employment of 802.15.4 as the wireless communication protocol. Because of that, the results
				obtained in this project can be of great use to the Solar Impulse project.\\
	
		\end{itemize}
	
	\section{Findings}
	\label{sec:end-findings}

		At this point, with the development finished and having analyzed the project results and further work lines, it seems relevant to point out some of the findings drawn from the development of the project as a conclusion for this document. They have been obtained both during the development process and from the results of it, near the ending of the project.\\
		
		At the inception phase of the project, even having already decided to employ Android systems as the real-time data display for the system, the team had doubts about the actual applicability of Android as a base for the development of real-time applications like the one to be built in the project. During the development the fact that Android may not be the fittest environment for this kind of functionality became clear, as, even if the devices have, in general, high computational power and graphic capabilites, the restrictions imposed by the operating system substantially complicate the development of reliable real-time functionality.\\

		% Employment of Android for this real-time thingamagigs is not the best thing ever as, even if the devices have high computational power, the restrictions imposed by the operating system hardens the task quite a lot. In that scenario a custom display device would allow finer, prettier visualization of the data, BUT of course the benefits of employing Android like 1. it's already developed duh 2. simplicity of development of visually rich apps and, specially, 3. high availability of the devices which reduces the amount of devices carried, compensate for every drawback it may have. So, asuming some limitations in the display applications (which already can eventually or will be able to be overcome) the selection of Android as a platform has been awesomely great.
		In a system like the one developed in this project, the application of an specific display device would allow finer, prettier even, visualization of the ECG data within the real-time restrictions in which it needs to operate, but the benefits of employing Android significantly compensate for the aforementioned lacks. The most important of this benefits, at least in the scope of the project, are the simplicity of development of visually rich applications Android provides and, more importantly, the high availability of Android supporting devices. These have been exposed throughout this whole document, but they seemed worthy of one last remark. The selection of Android as the application target platform, assuming some limitations to the application, which already can, or eventually will be able to, be overcame, has been one of the best decisions made in the project.\\

		% Regarding the process of a project such as this that spawn various subprojects with different characteristics and highly related one on the other, the employment of a flexible schedule, a detailed risk management procedure and focusing a lot on the current objective and it's deadline is critical for a successful outcome.
		Even with the simplicity of development provided by the Android development kit, a development process, such as the one conducted for this project, that spawns various subprojects with different characteristics and each dependent on the overtaking of specific achievements on the other can be an specially complicated task to overcome if braved incorrectly. Moreover, the inherent uncertainty of the hardware research required even more care to be put in the scheduling tasks.\\

		Through the project development some key techniques have been applied and have proven to be of great relevance for the successful outcome of it. These are, as exposed before, the employment of a flexible schedule to allow change-prone, supposition based planning; a detailed risk management procedure to be prepared for countering the difficulties arised from planning modifications; and mantaining a constant focus on the current objective, as well as its deadline and dependant tasks, thanks to a use case driven development process. Great part of the success on the achievement of the objectives of this project can be granted to the careful application of these techniques.\\

		% Results:
		% Ideas: importance of monitorization systems for cardiovascular diseases affected people. Great potential of development in this area. Low cost, low sized, user focused designed, an thus, comfortable application system development is a ineherntly good goal, as are of great help for CVD affected people.
		Assessing now the utility of the performed development, the importance of monitorization systems for specific cardiovascular diseases affected people has become a reckoned fact through the development process. There is great potential of development in this area, specially when considering that these systems are bound to be used as a daily basis by people who need them. Projects targeting this field of interest must always consider the final user throughout the whole development as a little user oriented extra effort, like reducing the operations needed for monitorization initialization or simplifying the way in which the user inputs his/her commands, as small as the improvement may seem to be, can substantially improve the quality of life of the user. This is so because when using a system day after day, apparently minor nuisances in the system interface can become a constant source of frustration.\\

		% In this line, 802.15.4 as a low energy requiring wireless protocol significantly reduce the need of monitorization interruption due to battery recharging procedures, which seems like a small thing but is extra nice for minimizing the impact in the life style of the affected people. Also, employment of Android instead of iOS allows things like letting the application work in background while doing other things, shall not be interrupted by an incoming call and such. Also seem like small things but hell if you have to cope with them in day after day.
		Production of a low energy requiring monitoring system contributes to this by reducing the amount of interruptions to the monitoring process due to battery recharging procedures (and the subsequent halt of common activity because of these). As mentioned, thanks to the employment of the 802.15.4 wireless protocol, the life of the battery on the delineator node is improved in two orders of magnitude, which means recharging it once a week instead of twice a day.\\

		On the same line, employment of Android instead of iOS allows the monitoring application, which displays, and more importantly, logs the ECG data, to work in background in such a way that the operation is not interrupted by common events such an incoming phone call or the need to look something up on the Internet. Another important feature provided by Android is the ability for the applications to continue running when the device enters low power modes by, for example, disabling the display. Again, these may seem like small features, but for a person who needs constant monitoring they are of great importance as they affect his/her day to day life activity.\\
		%However, this behaviour iOS shows is likely due to a bug rather than a design feature. 

		% Interesting: Marian is interested in the project for personal monitorization, David Atienza (EPFL's ESL \& UCM) is highly interested in the lower energy costs this project has achieved. Also, Solar Flight.
		As if to corroborate these claims, when the project was entering the final phases of development, before even the beginning of the validation procedures, a cardiovascular disease affected person contacted the department to which the project is bound and shown great interest in this particular endeavour after being informed of the project goals and already achieved results. Further interaction with this person produced the potential short-term project explained in the previous section for the specialization of the system for the particular needs of the specific cardiovascular disease. This person is also in the process of testing the system in an actual employment scenario such as him/hers, the feedback from this yet to come as the time of the writing of this document, and is willing to colaborate in as much ways as possible with the project, as it could be of great use for him/her.\\

		Moreover, as exposed before, the director of the Embedded Systems Laboratory of the EPFL is also interested in the results obtained in this project for the application of them to the Solar Impulse project with the objective of constantly monitoring the pilot of the solar airplane. This airplane is equipped with a tablet device for various purposes, and the utilization of it as the monitoring display, as well as the reduction of the battery consumption of the delineator node as much as possible, being energy saving critical for solar flight, make this scenario a great one for the employment of the project results.\\

		Needless to say, these signs of interest in the project make this endeavour a personal success regardless of its actual outcome. The fact that the work carried out throughout the last months is being confirmed to be able to provide actual benefits to some people, which was, at heart, the ultimate goal for the project, renders all hardship involved in the process as mere anecdotic when compared to the personal pride it has, at the end, provided.
